/*
 * Copyright (C) 2010 Johan Waldeback
 *  
 * This file is part of the OpenFMS project (http://www.openfms-project.org)
 * 
 * OpenFMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef __GRAPHCTRL_H__
#define __GRAPHCTRL_H__

#include "GraphDataSet.h"
#include <wx/window.h>

namespace OpenFms {

/**
 * \class GraphCtrl
 * \brief Visual control that displays a line chart.
 *
 * The OpenFms::GraphCtrl contains a OpenFms::GraphDataSet class that holds a list of 2D points.
 * The line chart is drawn by drawing a line between these piints in the order they are listed.
 * The axis are automatically scaled to fit all data points.
 * @note The storage of data points are handled by an instance of the OpenFms::GraphDataSet class.
 */

class GraphCtrl : public wxWindow
{
private:
	GraphDataSet m_data;  /**< Insatance of the OpenFms::GraphDataSet class that hold the lint of points to use */
public:
	GraphCtrl( wxWindow *parent, wxWindowID id);
	void OnPaint(wxPaintEvent& evt);
	void OnSize(wxSizeEvent& event);
	void setData( float *px, float *py, int count );
};

} // namespace OpenFms
#endif //  __GRAPHCTRL_H__